<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.Map"%>
<%@page import="com.sinba.common.system.dto.SingleGroupReportStatDTO"%>
<%@page import="java.util.List"%>
<%@page import="com.sinba.common.dto.PageDTO"%>
<%@page import="com.sinba.common.system.dto.TransactionRecordDTO"%>
<%@page import="com.sinba.common.system.service.ITransactionRecordService"%>
<%@page import="com.sinba.common.user.dto.AccountDTO"%>
<%@page import="com.sinba.common.user.service.IAccountService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
if(session.getAttribute("password2")==null){
	response.sendRedirect( "login2.jsp?pageUrl=user/groupReport.jsp");
	return;
}
ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
ITransactionRecordService transactionRecordService = (ITransactionRecordService)ac.getBean("transactionRecordService");
TransactionRecordDTO trDTO = new TransactionRecordDTO();
trDTO.setLoginName((String)session.getAttribute("loginName"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(request.getParameter("optTime")!=null && request.getParameter("optTime")!="")
	trDTO.setOptDate(sdf.parse((String)request.getParameter("optTime")));
else
	trDTO.setOptDate(new Date());
trDTO.setTransactionTypes(new String[]{"销售佣金","销售管理佣金","财富见点佣金","财富见点管理佣金","成员倒钩佣金","运营中心","股票交易佣金","静态股票收益"});
Map<String, Double> groupReportStatDTO = transactionRecordService.transacGroupReportStat(trDTO);
request.setAttribute("groupReportStatDTO",groupReportStatDTO);

%>
<fmt:setLocale value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
	<fmt:setBundle basename="i18n.itilbase"/>
	<c:set var="lang" value="${empty cookie['language'].value?'zh_CN':cookie['language'].value}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="scripts/jquery/jqgrid/redmond/jquery-ui-1.8.1.custom.css">
<link rel="stylesheet" type="text/css" href="scripts/jquery/easyui/themes/default/easyui.css">
<script type="text/javascript" src="scripts/jquery/jquery-1.4.2.min.js"></script>
<script src="scripts/jquery/easyui/jquery.easyui.min.js"></script>
<script src="web/js/common.js"></script>
<script type="text/javascript" src="web/js/hall.js"></script>
<meta charset="UTF-8">
<title><fmt:message key="i18n.yongjinReport"/>-<fmt:message key="i18n.title"/></title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1" />
		
<script>

$(function(){
	//showTransRecord('tr_recommend_table','tr_recommend_pager','recommend',1,10,'optDate','desc');
	//showDirectPushUser('tr_recommendGrid_table','tr_recommendGrid_pager','${user.loginName}',1,10,'registerTime','desc');
    $("#doSeach").click(function(){
    	$("#bonusSeachForm").submit();
    });
    $("#reportTable").find("tr").addClass("color1");
	$("#reportTable").find("tr:odd").addClass("color2");
})

</script>
</head>
<body style="height:800px">
<jsp:include page="top.jsp"></jsp:include>

<!-- 主体内容 -->
<div class="wrapper">
	<div class="site"><fmt:message key="i18n.yourlocation"/>：<fmt:message key="i18n.moneyManage"/>   &gt;   <fmt:message key="i18n.yongjinReport"/></div>
	<div class="content">

<form id="bonusSeachForm" action="groupReport.jsp" method="post">
<table width="100%">
<tr>
 	<td>
 		<fmt:message key="i18n.date"/> <input id="optTime" name="optTime" class="easyui-datebox"></input>
 		<a style="cursor: pointer;" id="doSeach"><input type="button" value="搜索" /></a>
 	</td>
</tr>
</table>
</form>

<table class="mytable" id="reportTable">
		        		<thead>
		        			<tr>
		        				<th colspan="9"><fmt:message key="i18n.todayMoneyTotal"/></th>
		        			</tr>
		        			<tr>
		        				<th><fmt:message key="i18n.xiaoshouyongjin"/></th>
		        				<th><fmt:message key="i18n.xiaoshouManageyongJin"/></th>
		        				<th><fmt:message key="i18n.jiandianyongjin"/></th>
		        				<th><fmt:message key="i18n.jiandingManageyongjin"/></th>
		        				<th><fmt:message key="i18n.chengyuandaogouYJ"/></th>
		        				<th><fmt:message key="i18n.operateCenter"/></th>
		        				<th><fmt:message key="i18n.gupiaojiaoyiYJ"/></th>
		        				<th><fmt:message key="i18n.jtGuPiaoshouyi"/></th>
		        				<th><fmt:message key="i18n.totalMoney"/></th>
		        			</tr>
		        			
		        		</thead>
		        		<tbody>
		        			<tr>
	        					<td>${groupReportStatDTO['销售佣金']}</td>
	        					<td>${groupReportStatDTO['销售管理佣金']}</td>
	        					<td>${groupReportStatDTO['财富见点佣金']}</td>
	        					<td>${groupReportStatDTO['财富见点管理佣金']}</td>
	        					<td>${groupReportStatDTO['成员倒钩佣金']}</td>
	        					<td>${groupReportStatDTO['运营中心']}</td>
	        					<td>${groupReportStatDTO['股票交易佣金']}</td>
	        					<td>${groupReportStatDTO['静态股票收益']}</td>
	        					<td><fmt:formatNumber value="${groupReportStatDTO['总计']}" pattern="#0.0000"/></td>
		        				</tr>
		        		</tbody>		        		
		        	</table>
		        	
		        	</div></div>
		        <jsp:include page="bottom.jsp"></jsp:include>
</body>
</html>